<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">

            <div class="layui-card layui-tab  layui-tab-brief" lay-filter="linktab">
                <ul class="layui-tab-title">
                    <li class="layui-this">短信</li>
                    <li>创蓝</li>
                    <!--<li>阿里</li>-->
                </ul>
                <div class="layui-tab-content">
                    <div class="layui-tab-item layui-show">
                        <div class="layui-card">
                            <div class="layui-card-header">短信配置</div>
                            <div class="layui-card-body" pad15>
                                <div class="layui-form layui-form-pane">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label"><span style="color:#f90c05;">*</span>短信</label>
                                        <div class="layui-input-block">
                                            {volist name="sms_type" id="v"}
                                            <input type="radio" name="sms_type" value="{$v.value}" title="{$v.text}" {eq name=":array_get($sms,'sms_type')" value="$v['value']" }checked{/eq}>
                                            {/volist}
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label"><span style="color:#f90c05;">*</span>过期时间</label>
                                        <div class="layui-input-block">
                                            <input type="number" placeholder="短信验证码过期时间"
                                                   name="sms_verify_expire"
                                                   value="{:array_get($sms,'sms_verify_expire')}"
                                                   lay-verify="required"
                                                   class="layui-input">
                                            <div class="layui-form-mid layui-word-aux">登录验证码的过期时间，单位秒，建议于验证码短信模板保持一致</div>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <div class="layui-input-block">
                                            <button class="layui-btn" lay-submit lay-filter="{$lay_btn}">确认修改</button>
                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>
                    <div class="layui-tab-item">
                        <div class="layui-card">
                            <div class="layui-card-header">创蓝短信接口参数</div>
                            <div class="layui-card-body" pad15>
                                <div class="layui-form layui-form-pane">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label"><span style="color:#f90c05;">*</span>密钥 ID</label>
                                        <div class="layui-input-block">
                                            <input type="text" placeholder="请输入 AccessKey ID"
                                                   name="sms_chuanglan_appkey"
                                                   value="{:array_get($sms,'sms_chuanglan_appkey')}"
                                                   lay-verify="required"
                                                   class="layui-input">
                                            <div class="layui-form-mid layui-word-aux">访问创蓝API的密钥：app key</div>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label"><span style="color:#f90c05;">*</span>密钥 Secret</label>
                                        <div class="layui-input-block">
                                            <input type="text" placeholder="请输入 AccessKey Secret"
                                                   name="sms_chuanglan_secret"
                                                   value="{:array_get($sms,'sms_chuanglan_secret')}"
                                                   lay-verify="required"
                                                   class="layui-input">
                                            <div class="layui-form-mid layui-word-aux">访问创蓝API的密钥：secret key</div>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <div class="layui-input-block">
                                            <button class="layui-btn" lay-submit lay-filter="{$lay_btn}">确认修改</button>
                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>
                    <!--<div class="layui-tab-item">
                        <div class="layui-card">
                            <div class="layui-card-header">阿里云短信接口参数</div>
                            <div class="layui-card-body" pad15>
                                <div class="layui-form layui-form-pane">
                                    <div class="layui-form-item">
                                        <label class="layui-form-label"><span style="color:#f90c05;">*</span>密钥 ID</label>
                                        <div class="layui-input-block">
                                            <input type="text" placeholder="请输入 AccessKey ID"
                                                   name="sms_ali_accesskeyid"
                                                   lay-verify="required"
                                                   value="{:array_get($sms,'sms_ali_accesskeyid')}"
                                                   class="layui-input">
                                            <div class="layui-form-mid layui-word-aux">访问阿里云API的密钥：AccessKey ID</div>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label"><span style="color:#f90c05;">*</span>密钥 Secret</label>
                                        <div class="layui-input-block">
                                            <input type="text" placeholder="请输入 AccessKey Secret"
                                                   name="sms_ali_accesskeysecret"
                                                   lay-verify="required"
                                                   value="{:array_get($sms,'sms_ali_accesskeysecret')}"
                                                   class="layui-input">
                                            <div class="layui-form-mid layui-word-aux">访问阿里云API的密钥：AccessKey Secret
                                            </div>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">签名名称</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="sms_ali_signname"
                                                   value="{:array_get($sms,'sms_ali_signname')}" class="layui-input">
                                            <div class="layui-form-mid layui-word-aux"></div>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">注册验证</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="sms_ali_register"
                                                   value="{:array_get($sms,'sms_ali_register')}" class="layui-input">
                                            <div class="layui-form-mid layui-word-aux">注册验证模版CODE，验证码变量名称：code</div>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">密码重置</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="sms_ali_getpassword"
                                                   value="{:array_get($sms,'sms_ali_getpassword')}" class="layui-input">
                                            <div class="layui-form-mid layui-word-aux">密码重置模版CODE，验证码变量名称：code</div>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <label class="layui-form-label">登录验证</label>
                                        <div class="layui-input-block">
                                            <input type="text" name="sms_ali_mobilelogin"
                                                   value="{:array_get($sms,'sms_ali_mobilelogin')}" class="layui-input">
                                            <div class="layui-form-mid layui-word-aux">登录验证模版CODE，验证码变量名称：code</div>
                                        </div>
                                    </div>
                                    <div class="layui-form-item">
                                        <div class="layui-input-block">
                                            <button class="layui-btn" lay-submit lay-filter="{$lay_btn}">确认修改</button>
                                        </div>
                                    </div>
                                </div>

                            </div>
                        </div>
                    </div>-->
                </div>
            </div>

        </div>
    </div>
</div>

<script>
    layui.use(['index', 'form'], function () {
        const admin = layui.admin;
        const form = layui.form;
        form.render();

        form.on('submit({$lay_btn})', function (obj) {
            console.log(obj);
            admin.req({
                url: "{:url('setting/editSms')}",
                type: 'post',
                data: obj.field,
                done: function (res) {
                    layer.msg("提交成功", {icon: 1});
                }
            });

        });
    });
</script>
